I chose San Francisco as the final project because it’s one of my farviorte city in the states

#packages needed library(GISTools) library(dplyr) library(tidyverse) library(ggplot2) library(jsonlite) library(rgdal) library(sf) library(sp) library(tmap)

SanFran.Airbnblistings <- read.csv("~/Graduate_School_Rockhurst/BIA_6313_GIS_SpringA2020/Final Project/San Francisco Airbnb listings.csv", header = TRUE)

#change the first row to be the header
SanFran.Airbnb <- SanFran.Airbnblistings[-1,]
#filter only to private room
room_type <- data.frame(unique(SanFran.Airbnb$room_type))
library(tidyverse)
## -- Attaching packages -------------------------------------------------------------------------------------------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.2.1     v purrr   0.3.3
## v tibble  2.1.3     v dplyr   0.8.3
## v tidyr   1.0.0     v stringr 1.4.0
## v readr   1.3.1     v forcats 0.4.0
## -- Conflicts ----------------------------------------------------------------------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
Private_room <- SanFran.Airbnb %>% filter(room_type == "Private room")
SanFran.Airbnb <- filter(Private_room)
#delete columns that has no vlaue
SanFran.Airbnb <- SanFran.Airbnb[,-5]
#delete Hotels
SanFran.Airbnb <- SanFran.Airbnb[c(-2396,-2397,-2398,-2399,-2400,-2378,-2379,-2380,-2381),]
#convert a CSV file into a spatial object
library(rgdal)
## Loading required package: sp
## rgdal: version: 1.4-8, (SVN revision 845)
##  Geospatial Data Abstraction Library extensions to R successfully loaded
##  Loaded GDAL runtime: GDAL 2.2.3, released 2017/11/20
##  Path to GDAL shared files: C:/Users/aqsjo/OneDrive/Documents/R/win-library/3.5/rgdal/gdal
##  GDAL binary built with GEOS: TRUE 
##  Loaded PROJ.4 runtime: Rel. 4.9.3, 15 August 2016, [PJ_VERSION: 493]
##  Path to PROJ.4 shared files: C:/Users/aqsjo/OneDrive/Documents/R/win-library/3.5/rgdal/proj
##  Linking to sp version: 1.3-2
library(sf)
## Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
SF.Airbnb.Pvt <- SanFran.Airbnb
coordinates(SF.Airbnb.Pvt)= ~longitude+latitude
class(SF.Airbnb.Pvt)
## [1] "SpatialPointsDataFrame"
## attr(,"package")
## [1] "sp"
#setting the CRS WG84
proj4string(SF.Airbnb.Pvt) <- CRS("+init=EPSG:4326")
SF.Airbnb.Pvt@proj4string
## CRS arguments:
##  +init=EPSG:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
## +towgs84=0,0,0
plot(SF.Airbnb.Pvt)

library(rgdal)
SanFran <- readOGR("~/Graduate_School_Rockhurst/BIA_6313_GIS_SpringA2020/Final Project/SF Find Neighborhoods")
## OGR data source with driver: ESRI Shapefile 
## Source: "C:\Users\aqsjo\OneDrive\Documents\Graduate_School_Rockhurst\BIA_6313_GIS_SpringA2020\Final Project\SF Find Neighborhoods", layer: "geo_export_3e74eeed-3cd7-412f-9965-2ccca7c85b80"
## with 117 features
## It has 2 fields
class(SanFran)
## [1] "SpatialPolygonsDataFrame"
## attr(,"package")
## [1] "sp"
head(SanFran@data,20)
##                                                                                           link
## 0                            http://en.wikipedia.org/wiki/Sea_Cliff,_San_Francisco,_California
## 1                                                                                         <NA>
## 2                                                            http://www.nps.gov/prsf/index.htm
## 3                                                                                         <NA>
## 4                                        http://www.sfgate.com/neighborhoods/sf/innerrichmond/
## 5                                                                                         <NA>
## 6                                                                                         <NA>
## 7                                        http://www.sfgate.com/neighborhoods/sf/outerrichmond/
## 8                                       http://www.sfgate.com/neighborhoods/sf/goldengatepark/
## 9                 http://en.wikipedia.org/wiki/Neighborhoods_in_San_Francisco#Presidio_Heights
## 10                                                                                        <NA>
## 11                       http://en.wikipedia.org/wiki/Lone_Mountain,_San_Francisco,_California
## 12                                      http://en.wikipedia.org/wiki/Anza_Vista,_San_Francisco
## 13 http://sanfrancisco.about.com/od/neighborhoodprofiles/ig/sfmaps/Marina---Cow-Hollow-Map.htm
## 14                                                                                        <NA>
## 15                                             http://www.sfgate.com/neighborhoods/sf/nobhill/
## 16                                              http://www.sfgate.com/neighborhoods/sf/marina/
## 17                                  http://en.wikipedia.org/wiki/Telegraph_Hill,_San_Francisco
## 18                                         http://www.sfgate.com/neighborhoods/sf/unionsquare/
## 19                                          http://www.sfgate.com/neighborhoods/sf/tenderloin/
##                            name
## 0                      Seacliff
## 1                   Lake Street
## 2        Presidio National Park
## 3              Presidio Terrace
## 4                Inner Richmond
## 5                 Sutro Heights
## 6      Lincoln Park / Ft. Miley
## 7                Outer Richmond
## 8              Golden Gate Park
## 9              Presidio Heights
## 10 Laurel Heights / Jordan Park
## 11                Lone Mountain
## 12                   Anza Vista
## 13                   Cow Hollow
## 14                 Union Street
## 15                     Nob Hill
## 16                       Marina
## 17               Telegraph Hill
## 18      Downtown / Union Square
## 19                   Tenderloin
plot(SanFran)

#To see San Francisco by neighborhood color variance
library(sf)
SanFran_sf <- st_as_sf(SanFran)
class(SanFran_sf)
## [1] "sf"         "data.frame"
plot(SanFran_sf["name"])

SanFran@proj4string
## CRS arguments: +proj=longlat +ellps=WGS84 +no_defs
#change CRS to match Airbnb date frame
proj4string(SanFran) <- CRS("+init=EPSG:4326")
## Warning in `proj4string<-`(`*tmp*`, value = new("CRS", projargs = "+init=EPSG:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")): A new CRS was assigned to an object with an existing CRS:
## +proj=longlat +ellps=WGS84 +no_defs
## without reprojecting.
## For reprojection, use function spTransform
SanFran@proj4string
## CRS arguments:
##  +init=EPSG:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
## +towgs84=0,0,0
SF.Airbnb_sf <- st_as_sf(SF.Airbnb.Pvt)
class(SF.Airbnb_sf)
## [1] "sf"         "data.frame"

Map all the listings by private room type

library(tmap)
tm_shape(SanFran)+
  tm_polygons("white")+
  tm_shape(SF.Airbnb.Pvt)+
  tm_dots(size = 0.1, shape = 19, col = "red", alpha = 0.5)

library(tmap)
tm_shape(SanFran_sf)+
  tm_fill("white")+
  tm_borders()+
  tm_shape(SF.Airbnb_sf)+
  tm_dots(size = 0.1, shape = 19, col = "red", alpha = 0.5)+
  tm_text("neighbourhood", size = 0.2)

#Too many neighbourhood hard to see the name of each neighbourhood
library(mapview)
mapview(SF.Airbnb.Pvt)
tmap_mode("plot")
## tmap mode set to plotting

#Spatial Proximity Polygons

require(deldir)
## Loading required package: deldir
## deldir 0.1-25
require(sp)
voronoipolygons = function(layer) {
  crds <- layer@coords
  z <- deldir(crds[,1], crds[,2])
  w <- tile.list(z)
  polys <- vector(mode='list', length=length(w))
  for (i in seq(along=polys)) {
    pcrds <- cbind(w[[i]]$x, w[[i]]$y)
    pcrds <- rbind(pcrds, pcrds[1,])
    polys[[i]] <- Polygons(list(Polygon(pcrds)),
                           ID=as.character(i))
  }
  SP <- SpatialPolygons(polys)
  voronoi <- SpatialPolygonsDataFrame(SP, 
                                      data=data.frame(x = seq(length(SP)),
                                                      row.names=sapply(slot(SP, 'polygons'), 
                                                                       function(x) slot(x, 'ID'))))
  proj4string(voronoi) <- CRS(proj4string(layer))
  return(voronoi)
}


library(gstat)
library(tmap)


SF.Airbnb.voro <- voronoipolygons(SF.Airbnb.Pvt)
## 
##      PLEASE NOTE:  The components "delsgs" and "summary" of the
##  object returned by deldir() are now DATA FRAMES rather than
##  matrices (as they were prior to release 0.0-18).
##  See help("deldir").
##  
##      PLEASE NOTE: The process that deldir() uses for determining
##  duplicated points has changed from that used in version
##  0.0-9 of this package (and previously). See help("deldir").
tmap_mode('plot')
## tmap mode set to plotting
fpt <- tm_shape(SF.Airbnb.Pvt) + tm_dots(size=0.01)
fvr <- tm_shape(SF.Airbnb.voro) + tm_borders()
tmap_arrange(fpt,fvr)

library(gstat)
library(GISTools)
## Loading required package: maptools
## Checking rgeos availability: TRUE
## Loading required package: RColorBrewer
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
## Loading required package: rgeos
## rgeos version: 0.5-2, (SVN revision 621)
##  GEOS runtime version: 3.6.1-CAPI-1.10.1 
##  Linking to sp version: 1.3-2 
##  Polygon checking: TRUE
tmap_mode('view')
## tmap mode set to interactive viewing
sh <- shading(breaks=c(15,30,45,60,75),cols=brewer.pal(6,'YlGn'))
tm_shape(SF.Airbnb.voro) + tm_fill("lightgrey", col = 'x', alpha=0.6, title='Airbnb Price')

# Inverse Distance Weight(IDW)

library(maptools)
library(GISTools) 
library(gstat) # Set up the gstat package
# Define a sample grid then use it as a set of points 
# to estimate fulmar density via IDW, with alpha=1 (inverse relationship)
s.grid <- spsample(SF.Airbnb.voro,type='regular',n=10000)
idw.est <- gstat::idw(price~1,SF.Airbnb.Pvt,
                      newdata=s.grid,idp=1.0)
## [inverse distance weighted interpolation]
tmap_mode('view')
## tmap mode set to interactive viewing
tm_shape(idw.est) + tm_dots(col='var1.pred',border.col=NA,alpha=0.7)
tmap_mode('view')
## tmap mode set to interactive viewing
idw.grid <- SpatialPixelsDataFrame(idw.est,data.frame(idw.est)) 
tm_shape(idw.grid) + tm_raster(col='var1.pred',title='Price')

What about when the idp (alpha) = 2.0

idw.est2 <- gstat::idw(price~1,SF.Airbnb.Pvt,
                       newdata=s.grid,idp=2.0)
## [inverse distance weighted interpolation]
idw.grid2 <- SpatialPixelsDataFrame(idw.est2,data.frame(idw.est2)) 
tmap_mode('view')
## tmap mode set to interactive viewing
tm_shape(idw.grid2) +  tm_raster(col='var1.pred',title='Airbnb Price')
tmap_mode('plot')
## tmap mode set to plotting
idw1 <- tm_shape(idw.grid) +  tm_raster(col='var1.pred',title='Alpha = 1')
idw2 <- tm_shape(idw.grid2) +  tm_raster(col='var1.pred',title='Alpha = 2')
tmap_arrange(idw1,idw2)

What about when the idp (alpha) = 3.0

idw.est3 <- gstat::idw(price~1,SF.Airbnb.Pvt,
                       newdata=s.grid,idp=3.0)
## [inverse distance weighted interpolation]
idw.grid3 <- SpatialPixelsDataFrame(idw.est3,data.frame(idw.est3)) 
tmap_mode('view')
## tmap mode set to interactive viewing
tm_shape(idw.grid3) +  tm_raster(col='var1.pred',title='Airbnb Price')
tmap_mode('plot')
## tmap mode set to plotting
idw2 <- tm_shape(idw.grid2) +  tm_raster(col='var1.pred',title='Alpha = 2')
idw3 <- tm_shape(idw.grid3) +  tm_raster(col='var1.pred',title='Alpha = 3')
tmap_arrange(idw2,idw3)

Alpha changed from 1, 2 and 3, it displays opposite what I was expecting. when alpha increase, the prediction is lower

#Trend Surface Analysis

library(rgdal)
library(tmap)

SF.Airbnb.Pvt@bbox <- SF.Airbnb.voro@bbox

tm_shape(SF.Airbnb.voro) + tm_polygons() +
  tm_shape(SF.Airbnb.Pvt) +
  tm_dots(col="price", palette = "RdBu", auto.palette.mapping = FALSE,
          title="SF Airbnb Price \n", size=0.7) +
  tm_text("price", just="left", xmod=.5, size = 0.7) +
  tm_legend(legend.outside=TRUE)
## Warning: The argument auto.palette.mapping is deprecated. Please use
## midpoint for numeric data and stretch.palette for categorical data to
## control the palette mapping.

# Create an empty grid where n is the total number of cells
grd              <- as.data.frame(spsample(SF.Airbnb.Pvt, "regular", n=50000))
names(grd)       <- c("X", "Y")
coordinates(grd) <- c("X", "Y")
gridded(grd)     <- TRUE  # Create SpatialPixel object
fullgrid(grd)    <- TRUE  # Create SpatialGrid object

# Add P's projection information to the empty grid
proj4string(grd) <- proj4string(SF.Airbnb.Pvt)

# Define the 1st order polynomial equation
f.1 <- as.formula(price ~ X + Y) 

# Add X and Y to Houses
SF.Airbnb.Pvt$X <- coordinates(SF.Airbnb.Pvt)[,1]
SF.Airbnb.Pvt$Y <- coordinates(SF.Airbnb.Pvt)[,2]

# Run the regression model
lm.1 <- lm( f.1, data=SF.Airbnb.Pvt)

# Use the regression model output to interpolate the surface
dat.1st <- SpatialGridDataFrame(grd, data.frame(var1.pred = predict(lm.1, newdata=grd))) 

# Clip the interpolated raster to Texas
library(raster)
## 
## Attaching package: 'raster'
## The following objects are masked from 'package:MASS':
## 
##     area, select
## The following object is masked from 'package:dplyr':
## 
##     select
## The following object is masked from 'package:tidyr':
## 
##     extract
r   <- raster(dat.1st)
r.m <- mask(r, SF.Airbnb.voro)

# Plot the map
tm_shape(r.m) + 
  tm_raster(n=10, palette="RdBu", 
            title="SF Airbnb Price") +
  tm_shape(SF.Airbnb.Pvt) + tm_dots(size=0.2) +
  tm_legend(legend.outside=TRUE)

# Define the 2nd order polynomial equation
f.2 <- as.formula(price ~ X + Y + I(X*X)+I(Y*Y) + I(X*Y))

# Add X and Y to P
SF.Airbnb.Pvt$X <- coordinates(SF.Airbnb.Pvt)[,1]
SF.Airbnb.Pvt$Y <- coordinates(SF.Airbnb.Pvt)[,2]

# Run the regression model
lm.2 <- lm( f.2, data=SF.Airbnb.Pvt)

# Use the regression model output to interpolate the surface
dat.2nd <- SpatialGridDataFrame(grd, data.frame(var1.pred = predict(lm.2, newdata=grd))) 
## Warning in predict.lm(lm.2, newdata = grd): prediction from a rank-
## deficient fit may be misleading
# Clip the interpolated raster to Texas
r   <- raster(dat.2nd)
r.m <- mask(r, SF.Airbnb.voro)

# Plot the map
tm_shape(r.m) + 
  tm_raster(n=10, palette="RdBu",
            title="SF Airbnb Price") +
  tm_shape(SF.Airbnb.Pvt) + tm_dots(size=0.2) +
  tm_legend(legend.outside=TRUE)
## Variable "var1.pred" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.

### Comparing Linear and Polynomial models, I’d say the linear model seems present better prediction on the airbnb price based on locaitons

#Ordinary Kriging

#creating distance bands from 0 km to 250 km in step of 5km
require(gstat)
evgm <- variogram(price~1,SF.Airbnb.Pvt,
                  boundaries=seq(10,5000,l=51))
fvgm <- fit.variogram(evgm,vgm(10,"Mat",2500,1))#fit semivariogram using Matern function
## Warning in fit.variogram(evgm, vgm(10, "Mat", 2500, 1)): singular model in
## variogram fit
plot(evgm,model=fvgm)

krig.est <- krige(price~1,SF.Airbnb.Pvt,newdata=s.grid,model=fvgm)
## [using ordinary kriging]
krig.grid <- SpatialPixelsDataFrame(krig.est,krig.est@data)

krig.map.est <- tm_shape(krig.grid) + 
  tm_raster(col='var1.pred',title='SF Airbnb Price',palette='Reds') + 
  tm_layout(legend.bg.color='white',legend.outside = TRUE)
var.levs <- c(0,3,6,9,12,Inf) 
krig.map.var <- tm_shape(krig.grid) + 
  tm_raster(col='var1.var',title='Estimate Variance',palette='Reds') + 
  tm_layout(legend.bg.color='white',legend.outside = TRUE)
tmap_arrange(krig.map.est,krig.map.var)

### Ordinary Kriging shows softer layers than linear models, they have very simlar predictions that closer to downtown is more expensive on renting airbnb

Multiple Linear Regression

str(SanFran.Airbnb)
## 'data.frame':    3089 obs. of  15 variables:
##  $ id                            : int  7918 8142 8739 9225 12041 12042 12522 18904 21914 23611 ...
##  $ name                          : Factor w/ 8199 levels "'Painted Lady' Victorian Bedroom",..: 591 3049 4547 858 7515 7515 5376 4158 592 1261 ...
##  $ host_id                       : int  21994 21994 7149 29674 21994 21994 18431 72464 21994 18732 ...
##  $ host_name                     : Factor w/ 2188 levels "2nd Address",..: 7 7 845 678 7 7 260 1554 7 337 ...
##  $ neighbourhood                 : Factor w/ 37 levels "Bayview","Bernal Heights",..: 12 12 17 27 12 12 3 37 12 2 ...
##  $ latitude                      : num  37.8 37.8 37.8 37.8 37.8 ...
##  $ longitude                     : num  -122 -122 -122 -122 -122 ...
##  $ room_type                     : Factor w/ 4 levels "Entire home/apt",..: 3 3 3 3 3 3 3 3 3 3 ...
##  $ price                         : int  65 65 139 135 85 85 79 110 65 98 ...
##  $ minimum_nights                : int  32 32 1 1 32 32 3 2 32 3 ...
##  $ number_of_reviews             : int  18 8 726 531 6 5 423 409 14 254 ...
##  $ last_review                   : Factor w/ 922 levels "","1/1/2016",..: 836 839 380 391 867 121 382 386 757 24 ...
##  $ reviews_per_month             : num  0.14 0.12 5.66 4.23 0.06 0.06 3.45 4.1 0.14 2.12 ...
##  $ calculated_host_listings_count: int  9 9 2 1 9 9 1 2 9 2 ...
##  $ availability_365              : int  342 365 139 327 365 365 28 74 365 298 ...
library(corrplot)
## corrplot 0.84 loaded
corrs <- cor(SanFran.Airbnb[,c(9,10,11,14,15)])
corrplot(corrs, method = "number")

head(SanFran.Airbnb)
##      id                                               name host_id
## 1  7918         A Friendly Room - UCSF/USF - San Francisco   21994
## 2  8142 Friendly Room Apt. Style -UCSF/USF - San Francisco   21994
## 3  8739                Mission Sunshine, with Private Bath    7149
## 4  9225          Artful Potrero Separate Floor with Garden   29674
## 5 12041    Sunny/Sunset view room UCSF/USF - San Francisco   21994
## 6 12042    Sunny/Sunset view room UCSF/USF - San Francisco   21994
##      host_name  neighbourhood latitude longitude    room_type price
## 1        Aaron Haight Ashbury 37.76669 -122.4525 Private room    65
## 2        Aaron Haight Ashbury 37.76487 -122.4518 Private room    65
## 3 Ivan & Wendy        Mission 37.75919 -122.4224 Private room   139
## 4          Gae   Potrero Hill 37.76259 -122.4054 Private room   135
## 5        Aaron Haight Ashbury 37.77019 -122.4459 Private room    85
## 6        Aaron Haight Ashbury 37.76894 -122.4478 Private room    85
##   minimum_nights number_of_reviews last_review reviews_per_month
## 1             32                18   9/10/2019              0.14
## 2             32                 8   9/12/2018              0.12
## 3              1               726    2/3/2020              5.66
## 4              1               531    2/8/2020              4.23
## 5             32                 6   9/20/2018              0.06
## 6             32                 5  10/18/2015              0.06
##   calculated_host_listings_count availability_365
## 1                              9              342
## 2                              9              365
## 3                              2              139
## 4                              1              327
## 5                              9              365
## 6                              9              365
plot(SanFran)


SanFran.Airbnb.spdf <- SpatialPointsDataFrame(SanFran.Airbnb[,6:7], SanFran.Airbnb)

plot(SanFran.Airbnb.spdf, add=T, pch=16)

# Not sure why I couldn't plot the airbnb data frame and the neighbourhood spaital polygons data frame, and I couldn't find a San Francisco city outline shapefile
mean(SanFran.Airbnb.spdf$price)
## [1] 134.6225
sd(SanFran.Airbnb.spdf$price)
## [1] 191.6364
library(GWmodel)
## Loading required package: robustbase
## Loading required package: Rcpp
## Loading required package: spatialreg
## Loading required package: spData
## Loading required package: Matrix
## 
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
## 
##     expand, pack, unpack
## Welcome to GWmodel version 2.1-3.
## The new version of GWmodel 2.1-3 now is ready, and functions have been improved or revised:
##  1) gwr.scalable, Scalable GWR;
## 2) gwr.basic and bw.gwr
localstats1 <- gwss(SanFran.Airbnb.spdf, vars = c("price"), bw=50000) #bandwidth is 50km

head(data.frame(localstats1$SDF))
##   price_LM price_LSD price_LVar price_LSKe price_LCV latitude longitude
## 1 134.6225  191.6054   36712.64   25.27533  1.423279 37.76669 -122.4525
## 2 134.6225  191.6054   36712.64   25.27533  1.423279 37.76487 -122.4518
## 3 134.6225  191.6054   36712.64   25.27533  1.423279 37.75919 -122.4224
## 4 134.6225  191.6054   36712.64   25.27533  1.423279 37.76259 -122.4054
## 5 134.6225  191.6054   36712.64   25.27533  1.423279 37.77019 -122.4459
## 6 134.6225  191.6054   36712.64   25.27533  1.423279 37.76894 -122.4478
##   optional
## 1     TRUE
## 2     TRUE
## 3     TRUE
## 4     TRUE
## 5     TRUE
## 6     TRUE
library(RColorBrewer)
plot.new()
quick.map <- function(spdf,var,legend.title,main.title) {
  x <- spdf@data[,var]
  cut.vals <- pretty(x)
  x.cut <- cut(x,cut.vals)
  cut.levels <- levels(x.cut)
  cut.band <- match(x.cut,cut.levels)
  colors <- brewer.pal(length(cut.levels),'Reds')
  par(mar=c(1,1,1,1))
  plot(SanFran,col='grey85')
  title(main.title)
  plot(spdf,add=TRUE,col=colors[cut.band],pch=16)
  legend('topleft',cut.levels,col=colors,pch=16,bty='n',title=legend.title)
}

plot.new()
par(mfrow=c(1,2))
quick.map(localstats1$SDF, "price_LM",
          "US Dollar", "Geographically Weighted Mean")

quick.map(localstats1$SDF, "price_LSD",
          "US Dollar", "Local Standard Deviation")

## ----dogwr,cache=TRUE----------------------------------------------------
gwr.res <- gwr.basic(price~minimum_nights,
                     data=SanFran.Airbnb.spdf,bw=50000, kernel='gaussian')

## ----infogwr,size='tiny'-------------------------------------------------
gwr.res
##    ***********************************************************************
##    *                       Package   GWmodel                             *
##    ***********************************************************************
##    Program starts at: 2020-03-09 22:14:29 
##    Call:
##    gwr.basic(formula = price ~ minimum_nights, data = SanFran.Airbnb.spdf, 
##     bw = 50000, kernel = "gaussian")
## 
##    Dependent (y) variable:  price
##    Independent variables:  minimum_nights
##    Number of data points: 3089
##    ***********************************************************************
##    *                    Results of Global Regression                     *
##    ***********************************************************************
## 
##    Call:
##     lm(formula = formula, data = data)
## 
##    Residuals:
##    Min     1Q Median     3Q    Max 
## -134.6  -59.6  -34.6   15.4 7865.4 
## 
##    Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
##    (Intercept)     1.346e+02  3.449e+00  39.038   <2e-16 ***
##    minimum_nights -6.662e-07  1.917e-06  -0.348    0.728    
## 
##    ---Significance stars
##    Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
##    Residual standard error: 191.7 on 3087 degrees of freedom
##    Multiple R-squared: 3.913e-05
##    Adjusted R-squared: -0.0002848 
##    F-statistic: 0.1208 on 1 and 3087 DF,  p-value: 0.7282 
##    ***Extra Diagnostic information
##    Residual sum of squares: 113400895
##    Sigma(hat): 191.6637
##    AIC:  41240.18
##    AICc:  41240.19
##    ***********************************************************************
##    *          Results of Geographically Weighted Regression              *
##    ***********************************************************************
## 
##    *********************Model calibration information*********************
##    Kernel function: gaussian 
##    Fixed bandwidth: 50000 
##    Regression points: the same locations as observations are used.
##    Distance metric: Euclidean distance metric is used.
## 
##    ****************Summary of GWR coefficient estimates:******************
##                          Min.     1st Qu.      Median     3rd Qu.   Max.
##    Intercept       1.3464e+02  1.3464e+02  1.3464e+02  1.3464e+02 134.64
##    minimum_nights -6.6622e-07 -6.6622e-07 -6.6622e-07 -6.6622e-07   0.00
##    ************************Diagnostic information*************************
##    Number of data points: 3089 
##    Effective number of parameters (2trace(S) - trace(S'S)): 2 
##    Effective degrees of freedom (n-2trace(S) + trace(S'S)): 3087 
##    AICc (GWR book, Fotheringham, et al. 2002, p. 61, eq 2.33): 41240.19 
##    AIC (GWR book, Fotheringham, et al. 2002,GWR p. 96, eq. 4.22): 41236.18 
##    Residual sum of squares: 113400895 
##    R-square value:  3.912538e-05 
##    Adjusted R-square value:  -0.0006089374 
## 
##    ***********************************************************************
##    Program stops at: 2020-03-09 22:14:33